package csc.fresher_group2.dao;

import java.io.File;
import java.io.IOException;

import csc.fresher_group2.model.FileInfo;

/**
 * 
 * @author Phuc
 *
 */
public interface IFileDAO {

	/**
	 *
	 * @param path
	 * @return File get from path
	 */
	File getFileName(String path);
	
	/**
	 * 
	 * @param path
	 * @return array file from path
	 */
	FileInfo[] getFiles(String path);
	
	/**
	 * 
	 * @param path
	 * @return array file from path
	 */
	FileInfo[] getFilesExceptTrash(String path);
	
	
	
	
	/**
	 * 
	 * @param src
	 * @param des
	 * @return true if upload file success, false if fail
	 * @throws IOException 
	 */
	boolean uploadFile(String src, String des) throws IOException;
	
	/**
	 * 
	 * @param src
	 * @return true if delete a file success, false if fail
	 * @throws IOException 
	 */
	boolean deleteFile(String src, String dest) throws IOException;
	
	
	/**
	 * 
	 * @param src
	 * @return 
	 * @return true if delete a file success, false if fail
	 * @throws IOException 
	 */
	void deleteFile(File src) throws IOException;
	
	
	/**
	 * 
	 * @param src
	 * @return true if download file success, false if fail
	 */
	boolean downloadFile(String src);
	
	/**
	 * 
	 * @param path
	 * @return new File create from path 
	 */
	FileInfo newFolder(String path, boolean bNew) throws SecurityException ;
	
	/**
	 * 
	 * @param path
	 * @return share's link of file
	 */
	String shareAFile(String path);
	
	/**
	 * 
	 * @param src
	 * @param des
	 * @return true if move success, false if move not success
	 * @throws IOException 
	 */
	boolean moveFile(String src, String des) throws IOException;

	/**
	 * 
	 * @param src
	 * @param des
	 * @return true if copy file success, false if not
	 * @throws IOException
	 */
	boolean copyFile(String src, String des) throws IOException;
	
	/**
	 * 
	 */
	long calSizeOfFile(String path);

}
